#include<stdio.h>
#include<math.h>
double lnchoose(int n, int m)
{
	int i;
	if (m > n)
	{
		return 0;
	}
	if (m < n/2.0)
	{
		m = n-m;
	}
	double s1 = 0;
	for (i=m+1; i<=n; i++)
	{
		s1 += log((double)i);
	}
	double s2 = 0;
	int u = n-m;
	for (i=1; i<=u; i++)
	{
		s2 += log((double)i);
	}
	return s1-s2;
}

int choose(int n, int m)
{
	if (m > n)
	{
		return 0;
	}
	return (int)(exp(lnchoose(n, m))+0.5);
}
int main(int argc,char *argv[])
{
	int san;
	int yi;
	int i;
	int n;
	int sum;
	int count=0;
	while(scanf("%d",&n)!=EOF)
	{
		int result;
		count=0;
		for(san=0; san<=n/3; san++)
		{
			yi=n-san*3;
			sum=yi+san;
			result=choose(sum,san);
			count=count+result;
		}
		printf("%d\n",count);
	}
	return 0;
}
